<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template basic_option</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../program_options/reference.html#header.boost.program_options.option_hpp" title="Header &lt;boost/program_options/option.hpp&gt;">
<link rel="prev" href="invalid_bool_value.html" title="Class invalid_bool_value">
<link rel="next" href="option_description.html" title="Class option_description">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="invalid_bool_value.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.option_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="option_description.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.program_options.basic_option"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_option</span></h2>
<p>boost::program_options::basic_option</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../program_options/reference.html#header.boost.program_options.option_hpp" title="Header &lt;boost/program_options/option.hpp&gt;">boost/program_options/option.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> charT<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="basic_option.html" title="Class template basic_option">basic_option</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="basic_option.html#boost.program_options.basic_optionconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="basic_option.html#idp66541840-bb"><span class="identifier">basic_option</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_option.html#idp66541904-bb"><span class="identifier">basic_option</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_option.html#boost.program_options.basic_optionpublic-data-members">public data members</a></span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="basic_option.html#boost.program_options.basic_option.string_key"><span class="identifier">string_key</span></a><span class="special">;</span>
  <span class="keyword">int</span> <a class="link" href="basic_option.html#boost.program_options.basic_option.position_key"><span class="identifier">position_key</span></a><span class="special">;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span> <span class="identifier">charT</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <a class="link" href="basic_option.html#boost.program_options.basic_option.value"><span class="identifier">value</span></a><span class="special">;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span> <span class="identifier">charT</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <a class="link" href="basic_option.html#boost.program_options.basic_option.original_tokens"><span class="identifier">original_tokens</span></a><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="basic_option.html#boost.program_options.basic_option.unregistered"><span class="identifier">unregistered</span></a><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="basic_option.html#boost.program_options.basic_option.case_insensitive"><span class="identifier">case_insensitive</span></a><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp120884704"></a><h2>Description</h2>
<p>Option found in input source. Contains a key and a value. The key, in turn, can be a string (name of an option), or an integer (position in input source) -- in case no name is specified. The latter is only possible for command line. The template parameter specifies the type of char used for storing the option's value. </p>
<div class="refsect2">
<a name="idp120885376"></a><h3>
<a name="boost.program_options.basic_optionconstruct-copy-destruct"></a><code class="computeroutput">basic_option</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idp66541840-bb"></a><span class="identifier">basic_option</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="idp66541904-bb"></a><span class="identifier">basic_option</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> xstring_key<span class="special">,</span> 
             <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</span> <span class="special">&amp;</span> xvalue<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp120894912"></a><h3>
<a name="boost.program_options.basic_optionpublic-data-members"></a><code class="computeroutput">basic_option</code> 
        public
       public data members</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="boost.program_options.basic_option.string_key"></a><span class="identifier">string_key</span><span class="special">;</span></pre>
<p>String key of this option. Intentionally independent of the template parameter. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">int</span> <a name="boost.program_options.basic_option.position_key"></a><span class="identifier">position_key</span><span class="special">;</span></pre>
<p>Position key of this option. All options without an explicit name are sequentially numbered starting from 0. If an option has explicit name, 'position_key' is equal to -1. It is possible that both position_key and string_key is specified, in case name is implicitly added. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span> <span class="identifier">charT</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <a name="boost.program_options.basic_option.value"></a><span class="identifier">value</span><span class="special">;</span></pre>
<p>Option's value </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span> <span class="identifier">charT</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <a name="boost.program_options.basic_option.original_tokens"></a><span class="identifier">original_tokens</span><span class="special">;</span></pre>
<p>The original unchanged tokens this option was created from. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="boost.program_options.basic_option.unregistered"></a><span class="identifier">unregistered</span><span class="special">;</span></pre>
<p>True if option was not recognized. In that case, 'string_key' and 'value' are results of purely syntactic parsing of source. The original tokens can be recovered from the "original_tokens" member. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="boost.program_options.basic_option.case_insensitive"></a><span class="identifier">case_insensitive</span><span class="special">;</span></pre>
<p>True if string_key has to be handled case insensitive. </p>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2002-2004 Vladimir Prus<p>Distributed under the Boost Software License, Version 1.0.
      (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at 
      <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="invalid_bool_value.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.option_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="option_description.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
